#!/usr/bin/bash 

project_path_list=(
"group_path01/project_name_01"
"group_path02/project_name_02"
"group_path03/project_name_03"
"group_path04/project_name_04"
"group_path05/project_name_05"
"group_path06/project_name_06"
"group_path07/project_name_07"
"group_path08/project_name_08"
"group_path09/project_name_09"
"group_path11/project_name_11"
"group_path12/project_name_12"
"group_path13/project_name_13"
"group_path14/project_name_14"
"group_path15/project_name_15"
"group_path16/project_name_1611"
"group_path17/project_name_17111"
"group_path18/project_name_181111"
"group_path19/project_name_1911111"

)

title_list=("project_path" "group_path" "project_name")
declare -A project_version_info_list

function OutputFormatStr(){
    local project_path=${1}
	#echo ""${project_version_info_list["${project_path}"]}
    echo "${project_path} ${project_path##*/} ${project_path%%/*}"
	#project_version_info_list["${project_path}"]="'${project_path}' '${project_path##*/}' '${project_path%%/*}'"
	#echo ""${project_version_info_list["${project_path}"]}
	
}

for project_path in ${project_path_list[*]}
do
    project_version_info_list["${project_path}"]=$({
	    OutputFormatStr "${project_path}"
	} &)
done

wait


temp_list=""
#printf "%-101s\n" "" | sed "s/ /-/g"
#printf "|%-39s|%-29s|%-29s|\n" "${title_list[0]}" "${title_list[1]}" "${title_list[2]}"
#printf "%-101s\n" "" | sed "s/ /-/g"


show_table_str="${show_table_str}"`printf "%-101s\n" "" | sed "s/ /-/g"`"\n"
show_table_str="${show_table_str}"`printf "|%-39s|%-29s|%-29s|\n" "${title_list[0]}" "${title_list[1]}" "${title_list[2]}"`"\n"
show_table_str="${show_table_str}"`printf "%-101s\n" "" | sed "s/ /-/g"`"\n"

for project_path in ${project_path_list[*]}
do
    temp_list=(${project_version_info_list["${project_path}"]})
    #printf "|%-39s|%-29s|%-29s|\n" "${temp_list[0]}" "${temp_list[1]}" "${temp_list[2]}"
	#printf "%-101s\n" "" | sed "s/ /-/g"
	show_table_str="${show_table_str}"`printf "|%-39s|%-29s|%-29s|\n" "${temp_list[0]}" "${temp_list[1]}" "${temp_list[2]}"`"\n"
	show_table_str="${show_table_str}"`printf "%-101s\n" "" | sed "s/ /-/g"`"\n"
done

echo -e "${show_table_str%\\n}"